package com.example.factory;

import com.example.entity.Car;
import com.example.entity.Motor;
import com.example.entity.SteeringWheel;
import com.example.entity.Tyre;

/**
 * @author 深海
 * @version 1.0.0
 * @date 2023/01/14
 * @doc 汽车静态工厂
 * @since 1.0.0
 */
public class CarStaticFactory {

    public static Car getCar(){
        Car car = new Car();
        // 设置属性
        car.setMotor(new Motor());
        car.setSteeringWheel(new SteeringWheel());
        car.setTyre(new Tyre());
        // 调用相关方法进行调试
        car.testMotor();
        car.testSteeringWheel();
        car.testTyre();
        return car;
    }
}
